home *** CD-ROM | disk | FTP | other *** search
/ The PC-SIG Library 10 / The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso / PC_SIGCD / 02 / 1 / DISK0217.ZIP / NELIST.DOC < prev    next >
Text File  |  1984-12-23  |  11KB  |  331 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                  NELIST Pascal LISTER
  10.                                 Not copyright.  Enjoy
  11.  
  12.  
  13.               Borland's TURBO Pascal comes with an unadvertised source
  14.           lister called "TLIST."  Unfortunately, it doesn't quite work: at
  15.           least, on my printer (an Epson FX-80), it gets the page length
  16.           wrong.  This program does some of the things TLIST was supposed
  17.           to do, to wit:
  18.  
  19.             -  It lists a file with headers, including the date on page 1
  20.                and page numbers on subsequent pages.
  21.  
  22.             -  If desired, it marks the reserved words with underlining or
  23.                boldface.
  24.  
  25.             -  If desired, it numbers the lines.
  26.  
  27.             -  It will paginate automatically, but you can insert symbols
  28.                in the file to control page breaks.
  29.  
  30.               In addition, if you leave the reserved words unmarked, NELIST
  31.           will do a nice job of listing any sort of plain ASCII file.  Un-
  32.           like TINST, however, NELIST will not automatically insert the
  33.           text of files called with the {$Ifilename} command, nor does it
  34.           give you any choice of page headers.
  35.  
  36.  
  37.  
  38.  
  39.           The Files:
  40.  
  41.  
  42.           NELIST.DOC is the documentation you are now reading.
  43.  
  44.           NELIST.COM is the working compilation.  You run it from DOS.
  45.  
  46.           RESWORDS.TXT contains the list of reserved words NELIST uses if
  47.               you ask it to mark reserved words in the listing.  It must be
  48.               on the default disk when you run NELIST.
  49.  
  50.           NEPRN.DAT contains the printer control codes which NELIST uses
  51.               when it numbers the lines or marks the reserved words.  As it
  52.               comes, it contains the codes for an Epson FX-80, but it may
  53.               be changed by means of NEINST.  It must be on the default
  54.               drive when you run NELIST.
  55.  
  56.           NEINST.COM is an installation program to put the proper print
  57.               control symbols in NEPRN.DAT.  You don't need it to run
  58.               NELIST.  It's only required if you have to adapt NELIST for
  59.               your printer.
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.           NELIST.DOC                                                 Page 2
  69.  
  70.  
  71.  
  72.           NELIST.PAS is the source code for NELIST.COM.  You'll need it if
  73.               you have to recompile for a non-IBM machine.
  74.  
  75.           NEINST.PAS contains the source code for NEINST.COM.
  76.  
  77.  
  78.  
  79.  
  80.           Running NELIST
  81.  
  82.  
  83.               To run NELIST, you must have the two files, RESWORDS.TXT and
  84.           NEPRN.DAT on the default disk.  From DOS, run NELIST.  It will
  85.           ask you for the date and the file you want to list.  If you give
  86.           no extension, it will default to .PAS.  It will ask you to con-
  87.           firm the file name you give it and check whether the file ex-
  88.           ists.  Then it offers you some choices about how you want it
  89.           printed.  You must supply two characters:
  90.  
  91.             -  L will make it number the lines (and use elite type to keep
  92.                the lines from folding).
  93.  
  94.             -  U makes it underline the reserved words.
  95.  
  96.             -  E makes it boldface the reserved words.  (You can't have
  97.                both underlining and boldface.)
  98.  
  99.             -  If you don't want these things, enter a blank instead of the
  100.                letter.  Two blanks make it print plain.  (This option is
  101.                handy for printing any sort of text file, paginated, with
  102.                NELIST's headers.)
  103.  
  104.               It's very good about checking your choices, explaining your
  105.           errors, and letting you change your mind.
  106.  
  107.  
  108.  
  109.  
  110.           Pagination
  111.  
  112.  
  113.               If not otherwise instructed, NELIST will paginate automat-
  114.           ically.  If you want to control page breaks, put the following
  115.           symbols in the file:
  116.  
  117.             -  {.PA} produces an absolute page advance.  The line on which
  118.                the symbol appears will be the first line of the new page.
  119.  
  120.             -  {.CPnn} (where nn is a number) makes a conditional page
  121.                break.  If there isn't room for nn lines, it will start a
  122.                new page at that point.  If you look at the source code in
  123.                NELIST.PAS, you'll see it peppered with these to keep each
  124.                procedure whole.
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.           NELIST.DOC                                                 Page 3
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.           Adapting NELIST
  143.  
  144.  
  145.               As it comes, NELIST is designed to print source files from
  146.           TURBO Pascal (Versions 1.00 or 2.00) on an Epson FX-80 from an
  147.           IBM PC. If that's what you want to do, you can use NELIST.COM as
  148.           it is.  It can be adapted for other printers by changing the
  149.           print control symbols in NEPRN.DAT.  See the instructions for
  150.           other printers, below, for doing this.  There should be no
  151.           difficulty in using NELIST.COM with other Pascals (see below).
  152.           If you're using a non-IBM MS-DOS machine, you may have to compile
  153.           from NELIST.PAS and NEINST.PAS to make suitable .COM files.  I
  154.           think you could do the same if you're running TURBO Pascal in a
  155.           CP/M version.
  156.  
  157.  
  158.           For Other Pascals:
  159.  
  160.               The only Pascal I'm familiar with is Borland's TURBO Pascal.
  161.           As it comes, if your source code is in plain ASCII text files,
  162.           the only difficulty about other Pascals (or, for that matter,
  163.           other languages) ought to be the list of reserved words.  NELIST
  164.           would print the file, but it would mark only words reserved in
  165.           TURBO (versions 2.00 or earlier).
  166.  
  167.               The list of reserved words is in the file RESWORDS.TXT, so
  168.           all you need to do is rewrite the RESWORDS.TXT file to contain
  169.           your Pascal's reserved words.  Any text editor which makes plain
  170.           ASCII files will do.  Just make sure to
  171.  
  172.             -  Put one word on each line.
  173.  
  174.             -  Use lower case.
  175.  
  176.             -  Include no blanks.
  177.  
  178.           The order doesn't matter.  NELIST can handle up to 100 reserved
  179.           words (there are 43 in TURBO 1.00, 44 in TURBO 2.00) and the
  180.           words may be up to 10 characters long.  If you need more than
  181.           that, you'll have to rewrite the source code.  The only things
  182.           you'd have to change are the declarations at the beginning.  They
  183.           are identified with comments.
  184.  
  185.  
  186.           For Other Printers:
  187.  
  188.               On an Epson MX or an IBM printer, the underline and boldface
  189.           feature will work, but the line numbering will not be quite
  190.           right, because it calls for elite type, which these printers do
  191.           not have.  Therefore, long lines will fold.  If you write long
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.           NELIST.DOC                                                 Page 4
  201.  
  202.  
  203.  
  204.           lines and want them numbered, you should use NEINST to change the
  205.           print control symbols in NEPRN.DAT to call for condensed print.
  206.  
  207.               For other printers, you will have to consult your printer
  208.           manual to see what to insert.  Again, use NEPRN.DAT to change the
  209.           data in NEPRN.DAT.
  210.  
  211.  
  212.  
  213.  
  214.           Changing Print Control Symbols with NEINST
  215.  
  216.  
  217.               NELIST assumes that your printer can be made to underline, to
  218.           boldface (by "double-strike" &/or some other means), and to com-
  219.           press its type (at least to 12-character-per-inch "elite") by
  220.           sending it control codes of 1 to 3 characters.  These characters
  221.           must be in the data file, NEPRN.DAT, on the default drive when
  222.           you run NELIST.  Eight print control strings are required, start
  223.           and stop for each of the following:
  224.  
  225.             1.  Underlining
  226.  
  227.             2.  Double-strike
  228.  
  229.             3.  Emphasized type
  230.  
  231.             4.  Elite (or condensed, or some other small) typeface
  232.  
  233.           Further, it needs to be told whether your printer will feed out a
  234.           new page when it's sent a CHR #12 ("FF") and, if not, how many
  235.           lines it puts on a page.
  236.  
  237.               Look these up in your printer manual.  "Emphasized" is a
  238.           boldface type which the Epson FX's offer which is usually nicer
  239.           than double-strike.  If you don't have such a thing, use double-
  240.           strike for both.  Work out the ASCII numbers for those instruc-
  241.           tions.  NEINST requires the numbers, it can't accept characters.
  242.           Thus, to enter "Escape G", you would use the numbers, 27, 71.  27
  243.           is the ASCII number for "Escape", and 71 is the number for "G".
  244.           When you know what numbers you're going to need, put NEPRN.DAT on
  245.           the default drive, and run NEINST.
  246.  
  247.               Since it is a .COM file, NEINST, like NELIST runs straight
  248.           from DOS.  When you run it, NEINST goes through the set of
  249.           printer instructions, one by one.  It will show you what is cur-
  250.           rently in the data file and ask whether it's Okay.  To make a
  251.           change, type N, and it will ask what you want for that instruc-
  252.           tion.  You can use up to three ASCII numbers per instruction.
  253.           Enter the proper sequence of numbers (NUMBERS, not characters),
  254.           separating them with commas.  Since this is a nuisance to go
  255.           through, NEINST will confirm the numbers you've entered before
  256.           finally accepting it.  Make sure it's got the right numbers.  If
  257.           you've tried to enter a character instead of a number, NEINST
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.           NELIST.DOC                                                 Page 5
  267.  
  268.  
  269.  
  270.           will get it wrong.  It's worth noting that NEINST doesn't actu-
  271.           ally rewrite the file until it has all of the codes.  If you
  272.           panic and Ctrl-Break out of the program, it won't have changed
  273.           the data file.
  274.  
  275.               If you happen to run NEINST without NEPRN.DAT on the default
  276.           disk, no matter.  It won't have any current data to show you, but
  277.           it will go ahead and ask for the numbers you want, and create a
  278.           new NEPRN.DAT file on the default disk.
  279.  
  280.                                         Programmer: R. N. Wisan, June, 1984
  281.                                       37 Clinton Street, Oneonta, NY, 13820
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.